import request from '@/utils/request'

const URL = 'op/dishes'

export function addDishes(data) {
  return request({
    url: URL + '/add',
    method: 'post',
    data: data
  })
}

export function delDishes(data) {
  return request({
    url: URL + '/delete',
    method: 'post',
    data: {
      orderId: data
    }
  })
}

export function cancelDishes(id) {
  return request({
    url: URL + '/cancel',
    method: 'post',
    data: {
      orderId: id
    }
  })
}

export function updateDishes(data) {
  return request({
    url: URL + '/update',
    method: 'post',
    data: data
  })
}
export function payDish(id,payVal) {
  return request({
    url: URL + '/pay',
    method: 'post',
    data: {
      id: id,
      payVal: payVal
    }
  })
}

export function getDishesByUserId(data) {
  return request({
    url: URL + '/user/'+data,
    method: 'post',
    data: {
    }
  })
}


export function getDishesById(data) {
  return request({
    url: URL + '/'+data,
    method: 'post',
    data: {

    }
  })
}

export function getAllDishes() {
  return request({
    url: URL ,
    method: 'post',
  })
}

export function getDishesCount() {
  return request({
    url: URL + '/count',
    method: 'post',
  })
}
